def  scoreOut(n):
    if n>=90:
        print('A')
    elif n>=80:
        print('B')
    elif n>=70:
        print('C')
    elif n>=60:
        print('D')
    else:
        print('F')
        
for i in range(6):
    n = int(input())
    scoreOut(n)